package com.matrix.math;

/**
 * Constant class that implements the math object.
 * @author Sultan
 *
 */
public class Constant implements MathObject
{
	/**
	 * instance variables
	 */
	private String name;
	private String TAG;
	private double value;
	
	/**
	 * constructor
	 */
	public Constant()
	{
		this.name = "";
		this.value = (Double) null;
		this.TAG = "constant";
	}

	/**
	 * overriden constructor
	 * @param value
	 */
	public Constant(double value)
	{
		this.name = "";
		this.value = value;
		this.TAG = "constant";
	}
	public Constant clone()
	{
		return new Constant(value);
	}
	public String getName(){return this.name;}
	public void setName(String what)
	{
		this.name = what;
	}
	public String getTag() {return TAG;}
	public void setTAG(String tAG){TAG = tAG;}
	public double getValue(){return value;}
	public void setValue(double value){this.value = value;}

	@Override
	public String getInfo()
	{
		return getName()+"\n"+getValue();
	}
	
	/**
	 * to string method to convert this class to a string
	 * that can be used in the listView in the main activity.
	 */
	public String toString()
	{
		return this.getName() + " : " + this.getValue();
	}
}
